wayland: Fix the popover race workaround
authorMatthias Clasen <mclasen@redhat.com>
Wed, 12 Jun 2019 19:07:29 +0000 (19:07 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 13 Jun 2019 01:50:16 +0000 (21:50 -0400)
The Wayland backend has a hack to work around
a race with popover mapping: If the surface size
changes before the initial configure, we hide and
show the surface. Unfortunately, the code was doing
this in a way that is externally observable (by
listening for surface state changes), and popovers
were observing it and hiding themselves in response.

Avoid this by not going through the GDK frontend
code for this.

gdk/wayland/gdksurface-wayland.c

index 658b3569f651054b0570f5cd9e823338403bba2d..1bc06568c7e1f3da209133e684c3c85e1bb3293c 100644 (file)
@@ -696,6 +696,10 @@ is_realized_popup (GdkSurface *surface)
           impl->display_server.zxdg_popup_v6);
 }
 
+static void gdk_wayland_surface_show (GdkSurface *surface,
+                                      gboolean    already_mapped);
+static void gdk_wayland_surface_hide (GdkSurface *surface);
+
 static void
 gdk_wayland_surface_maybe_configure (GdkSurface *surface,
                                      int         width,
@@ -721,12 +725,12 @@ gdk_wayland_surface_maybe_configure (GdkSurface *surface,
   is_visible = gdk_surface_is_visible (surface);
 
   if (is_xdg_popup && is_visible && !impl->initial_configure_received)
-    gdk_surface_hide (surface);
+    gdk_wayland_surface_hide (surface);
 
   gdk_wayland_surface_configure (surface, width, height, scale);
 
   if (is_xdg_popup && is_visible && !impl->initial_configure_received)
-    gdk_surface_show (surface);
+    gdk_wayland_surface_show (surface, FALSE);
 }
 
 static void